<?php session_start(); 

include_once('../../config.inc');
include_once(ROOT.'/database/open_api.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>

	<script type="text/javascript">
		function open_login()
		{
			window.open("sina_login.php","SinaLogin","width=600,height=450,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
		}
	</script>
	
	<body>
		<br>
<?php
	if (isset($_SESSION["sina_username"]))
	{
		$name = $_SESSION["sina_username"];
?>
		您好,<?=$name?>!<a href='../function/clear_session.php'>退出</a>
		<br><br>
		<form method="post" action="sina_add_weibo.php">
			<input type="text" name="content" />
			<br>
			<input type="submit" value="发布微博" />
		</form>
		<br><br>
<?php
		print_r($_SESSION);
	}
	else
	{
?>
		<a onclick='open_login()'><img src='../img/sina_login.png'></a>
<?php
		get_open_login(1);
	}
?>
	</body>
</html>
